<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>管理员登录</title>
<script type="text/javascript" src="/resource/admin/js/jquery.js"></script>
<link href="/resource/admin/css/common.css" rel="stylesheet" type="text/css" />
<link href="/resource/admin/css/fqg.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function(){
        [#if msg]
            alert("${msg}");
        [/#if]
    });
</script>
</head>
<body>
    <div class="header">
        <div class="container">
            <div class="login_t">
                <img src="/resource/admin/images/logo_fqg.png" alt=""/>
            </div>
        </div>
    </div>
    <div class="container-wrap login-wrap">
        <div class="container" style="padding: 60px 0;">
            <div class="login">
                <div class="panel-head">
                    <strong>平台登录</strong>Operator Login
                </div>
                <form id="loginForm" action="/login" method="POST">
                    <input type="hidden" id="enPassword" name="enPassword" />
                    <input type="hidden" name="tag"  value="fqg"/>
                    <input type="hidden" name="redirectUrl"  value="${redirectUrl}"/>
                    <input type="hidden" name="captchaId"  value="${captchaId}"/>
                    <table>
                        <tr>
                            <th>账户名</th>
                            <td style="position: relative">
                                <input type="text" id="username" name="username" class="text" minlength="8" maxlength="20" value="" placeholder="账号" />
                                <span class="login_sprite icon_m"></span>
                            </td>
                        </tr>
                        <tr>
                            <th>密码</th>
                            <td  style="position: relative">
                                <input type="password" id="password" name="password" class="text"  minlength="8" maxlength="20"  autocomplete="off" value="" placeholder="密码" />
                                <span class="login_sprite icon_p"></span>
                            </td>
                        </tr>
                        <tr>
                            <th>验证码</th>
                            <td>
							<span class="fieldSet">
									<input type="text" id="captcha" name="captcha" class="text captcha" style="width: 40%;" maxlength="4" autocomplete="off" /><img id="captchaImage" class="captchaImage" src="${base}/common/captcha.do?captchaId=${captchaId}" title="验证码" />
							</span>
                            </td>
                        </tr>
                        <tr>
                            <th>&nbsp;</th>
                            <td>
                                <input type="submit" class="submit" value="登录" />
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>


    <script type="text/javascript" src="/resource/admin/js/jquery.validate.js"></script>
    <script type="text/javascript" src="/resource/admin/js/jsbn.js"></script>
    <script type="text/javascript" src="/resource/admin/js/prng4.js"></script>
    <script type="text/javascript" src="/resource/admin/js/rng.js"></script>
    <script type="text/javascript" src="/resource/admin/js/rsa.js"></script>
    <script type="text/javascript" src="/resource/admin/js/base64.js"></script>

    <script type="text/javascript">
        $().ready(function() {
            var $loginForm = $("#loginForm");
            var $enPassword = $("#enPassword");
            var $username = $("#username");
            var $password = $("#password");
            var $captcha = $("#captcha");
            var $captchaImage = $("#captchaImage");
            var $isRememberUsername = $("#isRememberUsername");
            var $submit = $(":submit");

            // 更换验证码
            $captchaImage.click(function() {
                $captchaImage.attr("src", "/common/captcha.do?captchaId=${captchaId}&timestamp=" + (new Date()).valueOf());
            });
            // 表单验证、记住用户名
            $loginForm.submit(function() {
                if (!$loginForm.valid()) {
                    return false;
                }
                var rsaKey = new RSAKey();
                rsaKey.setPublic(b64tohex("${modulus}"), b64tohex("${exponent}"));
                var enPassword = hex2b64(rsaKey.encrypt($password.val()));
                $enPassword.val(enPassword);
                $password.val("");
            });
        });
    </script>
</body>
</html>